# 整数变换

def count_time(n):
    cnt = 0
    while n != 0:
        r = n
        temp = 0
        while r != 0:
            temp += r % 10
            r //= 10
        n -= temp
        cnt += 1
    return cnt


if __name__ == '__main__':
    print(count_time(23 * 10e8))
